<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class Order extends Migration
{
    /**
     * 订单表
     *
     * @return void
     */
    public function up()
    {
        //
        if (!Schema::hasTable('orders')) {
            Schema::create('orders', function (Blueprint $table) {
                $table->increments('id');
                $table->bigInteger('onum')->comment('订单号');
                $table->integer('uid')->comment('买家id');
                $table->integer('oStatus')->default('0')->comment('0=>待付款 1=>待发货  2=>待收货 3=>待评价 4=>退换货 5=>完成');
                $table->integer('counts')->default('1')->comment('商品数量');
                $table->integer('sendTime')->comment('发货时间');
                $table->integer('orderMoney');
                $table->enum('payment',['0','1'])->default('0')->comment('支付方式,0->网上支付,1->余额支付');
                $table->integer('goods_id')->comment('商品id');
                $table->integer('shop_id')->comment('店铺id');
                $table->softDeletes('deleted_at')->comment('软删除');
                $table->integer('addr_id')->comment('地址id');
                $table->timestamps();
            }); 

        }

    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        // Schema::drop('orders');
    }
}
